home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 2 / AACD 2.iso / AACD / Programming / fpc / amigaunits / prtbase.pas < prev    next >
Pascal/Delphi Source File  |  1998-09-22  |  6KB  |  166 lines

  1. {
  2.     This file is part of the Free Pascal run time library.
  3.  
  4.     A file in Amiga system run time library.
  5.     Copyright (c) 1998 by Nils Sjoholm
  6.     member of the Amiga RTL development team.
  7.  
  8.     See the file COPYING.FPC, included in this distribution,
  9.     for details about the copyright.
  10.  
  11.     This program is distributed in the hope that it will be useful,
  12.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14.  
  15.  **********************************************************************}
  16.  
  17. {
  18.         printer device data definition
  19. }
  20.  
  21. unit prtbase;
  22.  
  23. INTERFACE
  24.  
  25. uses exec, parallel, serial, amigados, intuition, timer;
  26.  
  27.  
  28. Type
  29.  
  30.     pDeviceData = ^tDeviceData;
  31.     tDeviceData = record
  32.         dd_Device       : tLibrary;     { standard library node }
  33.         dd_Segment      : Pointer;      { A0 when initialized }
  34.         dd_ExecBase     : Pointer;      { A6 for exec }
  35.         dd_CmdVectors   : Pointer;      { command table for device commands }
  36.         dd_CmdBytes     : Pointer;      { bytes describing which command queue }
  37.         dd_NumCommands  : Word;         { the number of commands supported }
  38.     end;
  39.  
  40. Const
  41.  
  42.     P_OLDSTKSIZE        = $0800;        { stack size for child task }
  43.     P_STKSIZE           = $1000;
  44.     P_BUFSIZE           = 256;          { size of internal buffers for text i/o }
  45.     P_SAFESIZE          = 128;          { safety margin for text output buffer }
  46.  
  47. Type
  48.        pPrinterData = ^tPrinterData;
  49.        tPrinterData = record
  50.             pd_Device : tDeviceData;
  51.             pd_Unit : tMsgPort;
  52.             pd_PrinterSegment : BPTR;
  53.             pd_PrinterType : WORD;
  54.             pd_SegmentData : Pointer;
  55.             pd_PrintBuf : Pointer;
  56.             pd_PWrite : Pointer;
  57.             pd_PBothReady : Pointer;
  58.             pd_ior0 : record
  59.                 case longint of
  60.                    0 : ( pd_p0 : tIOExtPar );
  61.                    1 : ( pd_s0 : tIOExtSer );
  62.                 end;
  63.             pd_ior1 : record
  64.                 case longint of
  65.                    0 : ( pd_p1 : tIOExtPar );
  66.                    1 : ( pd_s1 : tIOExtSer );
  67.                 end;
  68.             pd_TIOR : tTimeRequest;
  69.             pd_IORPort : tMsgPort;
  70.             pd_TC : tTask;
  71.             pd_OldStk : array[0..(P_OLDSTKSIZE)-1] of BYTE;
  72.             pd_Flags : BYTE;
  73.             pd_pad : BYTE;
  74.             pd_Preferences : tPreferences;
  75.             pd_PWaitEnabled : BYTE;
  76.             pd_Flags1 : BYTE;
  77.             pd_Stk : array[0..(P_STKSIZE)-1] of BYTE;
  78.          end;
  79.  
  80. Const
  81.  
  82. { Printer Class }
  83.  
  84.     PPCB_GFX            = 0;            { graphics (bit position) }
  85.     PPCF_GFX            = 1;            { graphics (and/or flag) }
  86.     PPCB_COLOR          = 1;            { color (bit position) }
  87.     PPCF_COLOR          = 2;            { color (and/or flag) }
  88.  
  89.     PPC_BWALPHA         = 0;            { black&white alphanumerics }
  90.     PPC_BWGFX           = 1;            { black&white graphics }
  91.     PPC_COLORALPHA      = 2;            { color alphanumerics }
  92.     PPC_COLORGFX        = 3;            { color graphics }
  93.  
  94. { Color Class }
  95.  
  96.     PCC_BW              = 1;            { black&white only }
  97.     PCC_YMC             = 2;            { yellow/magenta/cyan only }
  98.     PCC_YMC_BW          = 3;            { yellow/magenta/cyan or black&white }
  99.     PCC_YMCB            = 4;            { yellow/magenta/cyan/black }
  100.     PCC_4COLOR          = 4;            { a flag for YMCB and BGRW }
  101.     PCC_ADDITIVE        = 8;            { not ymcb but blue/green/red/white }
  102.     PCC_WB              = 9;            { black&white only, 0 == BLACK }
  103.     PCC_BGR             = 10;           { blue/green/red }
  104.     PCC_BGR_WB          = 11;           { blue/green/red or black&white }
  105.     PCC_BGRW            = 12;           { blue/green/red/white }
  106.  
  107. {
  108.         The picture must be scanned once for each color component, as the
  109.         printer can only define one color at a time.  ie. If 'PCC_YMC' then
  110.         first pass sends all 'Y' info to printer, second pass sends all 'M'
  111.         info, and third pass sends all C info to printer.  The CalComp
  112.         PlotMaster is an example of this type of printer.
  113. }
  114.  
  115.     PCC_MULTI_PASS      = $10;          { see explanation above }
  116.  
  117. Type
  118.  
  119.     pPrinterExtendedData = ^tPrinterExtendedData;
  120.     tPrinterExtendedData = record
  121.         ped_PrinterName : STRPTR;       { printer name, null terminated }
  122.         ped_Init        : Pointer;      { called after LoadSeg }
  123.         ped_Expunge     : Pointer;      { called before UnLoadSeg }
  124.         ped_Open        : Pointer;      { called at OpenDevice }
  125.         ped_Close       : Pointer;      { called at CloseDevice }
  126.         ped_PrinterClass : Byte;        { printer class }
  127.         ped_ColorClass  : Byte;         { color class }
  128.         ped_MaxColumns  : Byte;         { number of print columns available }
  129.         ped_NumCharSets : Byte;         { number of character sets }
  130.         ped_NumRows     : Word;         { number of 'pins' in print head }
  131.         ped_MaxXDots    : ULONG;        { number of dots max in a raster dump }
  132.         ped_MaxYDots    : ULONG;        { number of dots max in a raster dump }
  133.         ped_XDotsInch   : Word;         { horizontal dot density }
  134.         ped_YDotsInch   : Word;         { vertical dot density }
  135.         ped_Commands    : Pointer;      { printer text command table }
  136.         ped_DoSpecial   : Pointer;      { special command handler }
  137.         ped_Render      : Pointer;      { raster render function }
  138.         ped_TimeoutSecs : Longint;      { good write timeout }
  139.  
  140.         { the following only exists if the segment version is >= 33 }
  141.  
  142.         ped_8BitChars   : Pointer;      { conv. strings for the extended font }
  143.         ped_PrintMode   : Longint;      { set if text printed, otherwise 0 }
  144.  
  145.         { the following only exists if the segment version is >= 34 }
  146.         { ptr to conversion function for all chars }
  147.  
  148.         ped_ConvFunc    : Pointer;
  149.     end;
  150.  
  151.  
  152.     pPrinterSegment = ^tprinterSegment;
  153.     tPrinterSegment = record
  154.         ps_NextSegment  : ULONG;        { (actually a BPTR) }
  155.         ps_runAlert     : ULONG;        { MOVEQ #0,D0 : RTS }
  156.         ps_Version      : Word;         { segment version }
  157.         ps_Revision     : Word;         { segment revision }
  158.         ps_PED          : tPrinterExtendedData;  { printer extended data }
  159.     end;
  160.  
  161. IMPLEMENTATION
  162.  
  163. end.
  164.  
  165.  
  166.